<%@ page language="java"  contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title><t:mutiLang langKey="common.add.param"/></title>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
</head>
<body style="overflow-y: hidden" scroll="no">
<t:formvalid formid="formobj" layout="div" dialog="true" action="woController.do?saveResponer">
	<input name="id" type="hidden" value="${wo_responer.id }">  
	<fieldset class="step">
	    <div class="form">
			<label class="Validform_label"><span style="color:red;">*</span> 班组: </label> 
			<input id="deptName" name="deptName" type="text" style="width:200px;" readonly="readonly" class="inputxt"   onclick="openZDepartmentSelect();" value="${wo_responer.deptName }" >
	        <input id="deptId" name="deptId" type="hidden" value="${wo_responer.deptId }">
		    <span class="Validform_checktip"> 请填选择班组 </span>
		</div>
		<div class="form">
			<label class="Validform_label"><span style="color:red;">*</span> 责任人名称: </label> 
			<input name="responerName" class="inputxt"  style="width:200px;" value="${wo_responer.responerName }" datatype="*2-20">
			<span class="Validform_checktip"> 请填写2~20位字符 </span>
		</div>
		
	</fieldset>
</t:formvalid>

<script type="text/javascript">
function openZDepartmentSelect() {
	$.dialog.setting.zIndex = 9999; 
	
	var orgIds = $("#deptId").val()+",";
	
	$.dialog({content: 'url:departController.do?departSelect&orgIds='+orgIds, zIndex: 2100, title: '组织机构列表', lock: true, width: '400px', height: '350px', opacity: 0.4, button: [
	   {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackZDepartmentSelect, focus: true},
	   {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
   ]}).zindex();
}

function callbackZDepartmentSelect() {
	  var iframe = this.iframe.contentWindow;
	  var treeObj = iframe.$.fn.zTree.getZTreeObj("departSelect");
	  var nodes = treeObj.getCheckedNodes(true);
	  
	  
	  if(nodes.length==1){
		  var ids='',names='';
		 // for(i=0;i<nodes.length;i++){
		     var node = nodes[0];
		     ids += node.id;
		     names += node.name;
		 // }
		  $('#deptName').val(names);
		  $('#deptName').blur();		
		  $('#deptId').val(ids);		
	 }else{
		 alert('请选择一个且只能一个班组！');
		 return false;
	 }
}
</script>
</body>
</html>
